package com.liwei.services;
import com.liwei.exception.MyLengthException;
import org.springframework.stereotype.Service;

@Service
public class DemoServicesImp implements DemoServices{

    @Override
    public float add(float opt1, float opt2) throws MyLengthException {
        if(opt1>1000||opt2>1000){
            throw new MyLengthException("填入数据>1000");
        }
        return opt1+opt2;
    }

    @Override
    public float div(float opt1, float opt2) {
        return opt1-opt2;
    }

    @Override
    public float mul(float opt1, float opt2) {
        return opt1*opt2;
    }

    @Override
    public float sub(float opt1, float opt2) {
        return opt1/opt2;
    }
}
